/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2024-2024. All rights reserved.
 * Description: nic port context.
 */

#ifndef HCCL_NETWORK_H
#define HCCL_NETWORK_H

#include "hccl_network_pub.h"
#include "hccl_common.h"
#include "hccl_ip_address.h"

namespace hccl {
class NetDevContext {
public:
    NetDevContext() {}
    ~NetDevContext() {}
    HcclResult Init(NicType nicType, s32 devicePhyId, s32 deviceLogicId, HcclIpAddress localIp,
        HcclIpAddress backupIp = HcclIpAddress(0));
    HcclResult Deinit();

    NicType GetNicType() const
    {
        return nicType_;
    }

    HcclIpAddress GetLocalIp() const
    {
        return localIp_;
    }

    HcclIpAddress GetBackupIp() const
    {
        return backupIp_;
    }

    s32 GetPhyId() const
    {
        return devicePhyId_;
    }

    s32 GetLogicId() const
    {
        return deviceLogicId_;
    }

private:
    NICDeployment nicDeployment_;
    s32 devicePhyId_;
    s32 deviceLogicId_;
    HcclIpAddress localIp_;
    HcclIpAddress backupIp_;
    NicType nicType_;
    bool isHostUseDevNic_{false};
    SocketHandle hostSocketHandle_{nullptr};
};
}

#endif
